<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script type="text">
        function test() { var num = 100; function a() { num--; console.log(num); } function b() { num++; console.log(num); } // 返回一个方法数组 return [a, b]; } var myArr = test(); myArr[0](); myArr[1]();
    </script>
    <script>
    </script>
</body>

</html>